
let word_map=new Map
let sentence='this is a book a b a a'
let words=sentence.split(' ')
for(let word of words){
  if(word_map.has(word)){
    let count=word_map.get(word)
    count++
    word_map.set(word,count)
  }
  else{
    word_map.set(word,1)
  }
}
for(let[key,value]of word_map){
  console.log(`${key}---->${value}`);
}
console.log(word_map.get('a'))